import React, { useCallback } from 'react';
import Captcha from 'react-captcha-code';

export const Basic = ({ onCaptchaChange }: { onCaptchaChange: any }) => {
  const handleClick = useCallback(
    (captcha: any) => {
      onCaptchaChange(captcha);
    },
    [onCaptchaChange],
  );

  return <Captcha charNum={4} onChange={handleClick} />;
};

export default Basic;
